<?php

/**
 * 获取活动标签
 */
/*function getActivityTypeById($id){
    $activityType = D('ActivityType')->getOne(array('id'=>$id));
    return $activityType['type_name'];
}*/
/**
 * 获取活动名称
 */
//function getActivityById($id){
//    $activityType = D('Activity')->getOne(array('id'=>$id));
//    return $activityType['activity_name'];
//}



/**
 * 获取管理员姓名
 */
function getSysusersById($id){
    $activityType = D('Sysusers')->getOne(array('userid'=>$id));
    return $activityType['username'];
}




/**
 * 子任务获取活动名称
 */
function getLeaderById($id,$name){
    $activityLeader = D('ActivityLeader')->getOne(array('id'=>$id));
    if($name == 'activity_task'){
        return $activityLeader[$name];
    }else{
        $activity_name = getActivityById($activityLeader['activity_id'],$name);
        return $activity_name;
    }
}

/**
 * 获取活动名称
 */
function getActivityById($id,$name){
    $activity = D('Activity')->getOne(array('id'=>$id));
    if($name == 'type_id'){
        $typeName = getActivityTypeById($activity[$name]);
        return $typeName;
    }else{
        return $activity[$name];
    }
}

/**
 * 获取活动标签
 */
function getActivityTypeById($id){
    $activityType = D('ActivityType')->getOne(array('id'=>$id));
    return $activityType['type_name'];
}


/**
 * 获取活动标签
 */
function getattributeById($id,$name){
    $activityType = D('Attribute')->getOne(array('id'=>$id));
    return $activityType[$name];
}
